package gaml.text.parser;

import gaml.error.GamlException;
import gaml.text.YamlText;
import gaml.text.YamlTextParser;
import gaml.yaml.EmptyNode;
import gaml.yaml.YamlNode;


/**
 * parse empty node
 * @author shnireck_vi
 *
 */
public class EmptyNodeParser implements YamlTextParser {

	@Override
	public String getParsingTail (YamlText text) throws GamlException { return ""; }

	@Override
	public boolean isParserFor (YamlText text) throws GamlException { return "".equals (text.getValue ().trim ()); }

	@Override
	public YamlNode parseText (YamlText text, YamlNode parent) throws GamlException { return new EmptyNode (parent); }

}
